package com.tianji.learning.controller;


import com.tianji.common.domain.dto.PageDTO;
import com.tianji.learning.domain.page.QuestionAdminPageQuery;
import com.tianji.learning.domain.page.ReplyPageQuery;
import com.tianji.learning.domain.vo.QuestionAdminVO;
import com.tianji.learning.domain.vo.ReplyVO;
import com.tianji.learning.service.IInteractionQuestionService;
import com.tianji.learning.service.IInteractionReplyService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.*;

/**
 * <p>
 * 管理端回复及评论接口 前端控制器
 * </p>
 *
 * @author rui
 * @since 2024-07-21
 */
@RestController
@RequestMapping("/admin/replies")
@Api(tags = "管理端回复及评论接口")
@RequiredArgsConstructor
public class InteractionAdminReplyController {
    private final IInteractionReplyService replyService;
    @ApiOperation("分页查询管理端回复及评论")
    @GetMapping("/page")
    public PageDTO<ReplyVO> adminReplyPageQuery(ReplyPageQuery pageQuery){
        return replyService.adminReplyPageQuery(pageQuery);
    }
    @ApiOperation("隐藏回答或者评论")
    @PutMapping("/{id}/hidden/{hidden}")
    public void hiddenReply(@PathVariable("id")Long answerId,@PathVariable("hidden") Boolean hidden){
        replyService.hiddenReply(answerId,hidden);
    }
}
